﻿using System;

namespace AdTech.Snap
{
    /// <summary>
    /// Defines an interface for a Dropbox library used mainly to generated public links of files.
    /// </summary>
    public interface IDropboxFactory
    {
        // Properties
        /// <summary>
        /// Gets or sets the file location that a public link should point to.
        /// </summary>
        string Location { get; set; }
        /// <summary>
        /// Gets the path end relative to the Dropbox public folder.
        /// </summary>
        string RelativeLocation { get; }
        /// <summary>
        /// Gets or sets the Dropbox UserID.
        /// </summary>
        int UserID { get; set; }

        // Methods
        /// <summary>
        /// Generates a public Dropbox link for an existing file.
        /// </summary>
        /// <param name="filename">The name of the file.</param>
        /// <returns>A <see cref="System.Uri"/> of the public link.</returns>
        /// <remarks>
        /// This method just creates string including the given file 
        /// path and does not check whether the file actually exists.
        /// </remarks>
        Uri GenerateDropboxPublicLink(string filename);
        /// <summary>
        /// Tries to extract the Dropbox UserID from a public URL.
        /// </summary>
        /// <param name="publicURL">A public URL generated through Dropbox.</param>
        /// <returns>The extracted UserID or 0 if it could not be extracted.</returns>
        int ExtractUserID(string publicURL);
    }
}
